Socket
Socket
Sign inDemoInstall

globalthis

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

globalthis

ECMAScript spec-compliant polyfill/shim for `globalThis`


Version published
Weekly downloads
28M
increased by1.36%
Maintainers
1
Weekly downloads
 
Created

What is globalthis?

The globalthis npm package provides a polyfill for the global `globalThis` object, which is a standard way to access the global object (e.g., `window` in browsers, `global` in Node.js) in a universal manner across different JavaScript environments. This package ensures that you can reliably use `globalThis` in environments where it might not be natively supported.

What are globalthis's main functionalities?

Polyfill for globalThis

This code snippet demonstrates how to polyfill the global `globalThis` object using the globalthis package. After requiring and invoking the package, you can reliably use `globalThis` in your code to refer to the global object.

require('globalthis')(); // This will polyfill globalThis if it doesn't exist

Other packages similar to globalthis

Keywords

FAQs

Package last updated on 30 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc